<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>

<script>
  max = prompt("请输入较大的数");
  min = prompt("请输入较小的数");
  for (var i = min; i > 0; i--) {
    if ((max % i == 0) & (min % i == 0)) {
      console.log("最大公约数为" + i);
      break;
    }
  }
</script>
